package cn.itcast.order;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@MapperScan("cn.itcast.order.mapper")
@SpringBootApplication
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }
    /*
    需求是根据订单查询，把user表中的信息也显示出来
     */
    //原始方式，远程调用RestTemplate
    //在一台
    @Bean
    @LoadBalanced//负载均衡
    public RestTemplate createRestTemplate(){
        RestTemplate restTemplate = new RestTemplate();
        return restTemplate;
    }

}